package com.utooo.pojo.domain.purchase.task;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.utooo.pojo.domain.BaseDO;
import com.utooo.pojo.domain.purchase.DemandMaterialDetailDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购任务管理
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("aigis_cgrwgl_2025040108113814")
public class PurchaseTaskManagementDO extends BaseDO {

    /**
     * 状态 1:待受理 2:受理完成 3:关闭 4:变更中 5:部分受理
     */
    @TableField("selectField112")
    private String status;

    /**
     * 任务单号
     */
    @TableField("comInputField101")
    private String taskOrderNumber;

    /**
     * 公司
     */
    @TableField("selectField115")
    private String company;

    /**
     * 采购策略
     */
    @TableField("selectField117")
    private String purchaseStrategy;

    /**
     * 需求编号
     */
    @TableField("comInputField113")
    private String demandNumber;

    /**
     * 需求标题
     */
    @TableField("comInputField114")
    private String demandTitle;

    /**
     * 物料编码
     */
    @TableField("selectField120")
    private String materialNumber;

    /**
     * 物料名称
     */
    @TableField("comInputField104")
    private String materialName;

    /**
     * 初始采购员
     */
    @TableField("selectField116")
    private String initialPurchaser;

    /**
     * 当前采购员
     */
    @TableField("selectField121")
    private String purchaser;

    /**
     * 受理策略
     */
    @TableField("comInputField107")
    private String purchaseDeptStrategy;

    /**
     * 不含税单价
     */
    @TableField("numInputField119")
    private BigDecimal unitPriceExcludingTax;

    /**
     * 含税单价
     */
    @TableField("numInputField118")
    private BigDecimal unitPriceIncludingTax;

    /**
     * 物料信息
     */
    @TableField("selectField122")
    private String materialInfo;

    /**
     * 退回理由
     */
    @TableField("comInputField123")
    private String returnReason;

    /**
     * 任务总数量
     */
    @TableField("numInputField108")
    private Integer totalQuantity;

    /**
     * 已受理数量
     */
    @TableField("numInputField109")
    private Integer acceptedQuantity;

    /**
     * 待受理数量
     */
    @TableField("numInputField110")
    private Integer pendingAcceptanceQuantity;

    /**
     * 是否自动合单
     */
    @TableField("comInputField111")
    private String isAutoMergeOrder;

    public PurchaseTaskManagementDO(DemandMaterialDetailDO i) {
        this.status = "1";
        this.totalQuantity = i.getDemandQuantity();
        this.unitPriceIncludingTax = i.getUnitPriceIncludingTax();
        this.unitPriceExcludingTax = i.getUnitPriceExcludingTax();
//        this.purchaseDeptStrategy = i.getPurchaseStrategy();
        this.purchaser = i.getPurchaser();
        this.materialName = i.getMaterialName();
        this.materialNumber = i.getMaterialCode();
        this.initialPurchaser = i.getPurchaser();
        this.purchaseStrategy = i.getPurchaseStrategy();
    }
}